<{include file="common/header.tpl"}>
<section id="spread_one" class="column">

        <h4 class="alert_info">欢迎使用 哇吖管理系统！</h4>


        <form method="" action="">
        <article class="module width_3_quarter">
        <header>
            <h3 class="tabs_involved ">未通过审核的推广申请</h3>
            <!--
            <select class="spread_tab fl">
              <option value ="1">渠道1</option>
              <option value ="2">渠道2</option>
              <option value ="3">渠道3</option>
              <option value ="4">渠道4444</option>
            </select>
            -->
        </header>
		<div class="tab_container">
			<div id="tab1" class="tab_content">
			<table class="tablesorter" cellspacing="0"> 
			<thead> 
				<tr> 
   					
    				<th>名称</th> 
    				<th>渠道名称</th> 
    				<th>渠道商id</th> 
    				<th>资源地址</th>
    				<th>操作</th>
				</tr> 
			</thead> 
			<tbody>
			<{foreach from = $list item = 'v'}> 
					<tr>
						<td><{$v.act_name}></td>
						<td><{$v.cha_name}></td>
						<td><{$v.mer_id}></td>
                        <{if $v.pay_type == 'CPA'}>
						<td>
							<input type='text' name='url' value='请给出资源url111' class='url'>
							<input type='hidden' name='act_id' value='<{$v.act_id}>' class='act_id'>
							<input type='hidden' name='channel_id' value='<{$v.channel_id}>' class='channel_id'>
							</td>
                        <{elseif $v.pay_type == 'CPS'}>
						<td>
							<input type='hidden' name='url' value='请给出资源url111' class='url'>
							<input type='hidden' name='act_id' value='<{$v.act_id}>' class='act_id'>
							<input type='hidden' name='channel_id' value='<{$v.channel_id}>' class='channel_id'>
                            <i>(批准后，自动生成)</i>
						</td>
                        <{else}>
                        <td>
                            --
                        </td>
                        <{/if}>
						<td><input type='button' value='通过' class="passBtn" ></td>
					</tr> 
			<{/foreach}>
			</tbody> 
			</table>
			</div><!-- end of #tab1 -->
		</div><!-- end of .tab_container -->
		</article><!-- end of content manager article -->
		<div class="clear"></div>
	</section>			
<script>
$(function(){
		$("table tbody tr td .passBtn").each(function(){
			$(this).click(function(){
				var url = $(this).parent().prev().children(".url").val();
				var act_id = $(this).parent().prev().children(".act_id").val();
				var channel_id = $(this).parent().prev().children(".channel_id").val();
				$.ajax({
					type:"GET",
					url:'http://admin.union.哇吖.com/promotion/applies_verify',
					async: true,
					data:{
						'act_id': act_id,
						'channel_id' : channel_id,
						'url'  : url
					},
					dataType:"text",
					success:function(data)
					{
						if(data == 'success'){
							alert('审核成功！');
							window.location.reload();	
						}
					}
				});
			})
})
});
</script>
<{include file="common/footer.tpl"}>
